package com.lagou.no4

import akka.actor.Actor

class ActorB extends Actor{
  //初始化通信次数
  var count=0
  override def receive: Receive = {
    //接收到A发来的我打时，向A发送消息
    case "我打" => {
      count += 1
      println(s"ActorB(乔峰) 厉害 看我降龙十八掌 第${count}掌")
      Thread.sleep(1000)
      sender() ! "我打"
    }
  }
}